package com.tiantianyuegou.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.v7.widget.ActionBarOverlayLayout;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.tiantianyuegou.R;

/**
 * 重置支付密码
 */
public class ResetPayPSWActivity extends Activity implements View.OnClickListener {

    private ImageView img_title;
    private TextView text_title;

    private EditText edt_forget_pay, edt_validate;
    private Button btn_validate, btn_next;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_forget_pay_psw);
        init();
    }

    private void init() {
        text_title = (TextView) findViewById(R.id.text_title);
        img_title = (ImageView) findViewById(R.id.img_title);

        text_title.setText(R.string.reset_psw_title);
        img_title.setOnClickListener(this);

        edt_forget_pay = (EditText) findViewById(R.id.edt_forget_pay);
        edt_validate = (EditText) findViewById(R.id.edt_validate);
        btn_validate = (Button) findViewById(R.id.btn_validate);
        btn_next = (Button) findViewById(R.id.btn_next);

        btn_validate.setVisibility(View.INVISIBLE);
        btn_next.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.img_title:
                finish();
                break;
            case R.id.btn_next:
                break;
            default:
                break;

        }
    }

    private PopupWindow popupWindow = null;

    @SuppressLint("InflateParams")
    private void showpopupwindow() {
        View view = getLayoutInflater().inflate(R.layout.popupwindow_reminder,
                null);
        TextView txt_confirm = (TextView) view.findViewById(R.id.txt_confirm);
        txt_confirm.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                popupWindow.dismiss();

            }
        });

        popupWindow = new PopupWindow(view, ActionBarOverlayLayout.LayoutParams.MATCH_PARENT,
                ActionBarOverlayLayout.LayoutParams.MATCH_PARENT, true);
        popupWindow.setFocusable(true);
        popupWindow.setOutsideTouchable(true);
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.showAtLocation(text_title, Gravity.CENTER, 0, 0);

    }
}
